package com.yanq.liancar.adapter;
/*
 *  @创建者     Administrator
 *  @创建时间   2018/11/1  17:47
 *  @描述       ${TODO}
 */


import android.app.Application;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.amap.api.maps.AMap;
import com.amap.api.maps.model.Marker;
import com.yanq.liancar.R;
import com.yanq.liancar.base.BaseApp;

public class InfoWinAdapter implements AMap.InfoWindowAdapter,View.OnClickListener {
    private Context mContext= BaseApp.getContext();
    private TextView tv_title;
    private String title;
    @Override
    public void onClick(View view) {
        int id=view.getId();
        switch (id){

        }
    }

    @Override
    public View getInfoWindow(Marker marker) {
        initData(marker);
        View view=initView();
        return view;
    }

    @Override
    public View getInfoContents(Marker marker) {
        return null;
    }

    private void initData(Marker marker){
        title=marker.getTitle();
    }

    private View initView(){
        View view= LayoutInflater.from(mContext).inflate(R.layout.custom_view,null);
        tv_title=view.findViewById(R.id.title);
        tv_title.setText(title);
        return view;
    }
}
